




class sweetpotato:
    def __init__(self):
        self.cook_time=0
        self.cook_static='生的'
        self.condiments=[]
    def cook(self,time):
        self.cook_time+=time
        if 0<=self.cook_time<3:
            self.cook_static='生的'
        elif 3<=self.cook_time<5:
            self.cook_static='半生不熟'
        elif 5 <= self.cook_time<8:
            self.cook_static='熟了'
        elif self.cook_time>=8:
            self.cook_static='烤糊了'

    def add_condiments(self,condiment):
        self.condiments.append(condiment)

    def __str__(self):
        return f'这个地瓜考了{self.cook_time}分钟,状态是{self.cook_static},'f'添加的调料有{self.condiments}'

if __name__ == '__main__':
    digua = sweetpotato()
    digua.cook(2)
    digua.add_condiments('酱油')
    print(digua)
    digua.cook(2)
    digua.add_condiments('辣椒粉')
    print(digua)
    digua.cook(2)
    digua.add_condiments('nhj')
    print(digua)
    digua.cook(2)
    digua.add_condiments('4')
    print(digua)

